<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="count"></div>
    <script>
        async function getCount(){
            const response = await fetch('http://localhost:4000/count',{
                credentials:'include'//如果想让客户端在跨域的时候携带cookie,需要设置此项参数
            });
            const bodyData = await response.json();
            document.getElementById('count').innerHTML = bodyData.count;
        }
        getCount();
    </script>
</body>
</html>